package com.gcd.knowledge;

public class Node {
	public static final class TYPE {
		public static final Integer QUESTION = 0;
		public static final Integer SOLUTION = 1;
	}
	
	public static final class QUESTION {
		public static final int HAS_ANAK 				=  0;
		public static final int JUMLAH_ANAK 			=  1;
		public static final int JENIS_KELAMIN_ANAK		=  2;
		public static final int HAS_ISTRI 				=  3;
		public static final int HAS_SUAMI	 			=  4;
		public static final int HAS_BAPAK 				=  5;
		public static final int HAS_SAUDARA 			=  6;
		public static final int JUMLAH_SAUDARA 			=  7;
		public static final int JENIS_KELAMIN_SAUDARA 	=  8;
		public static final int HAS_ANAK_MENINGGAL 		=  9;
		public static final int HAS_CUCU 				= 10;
		public static final int JUMLAH_CUCU 			= 11;
		public static final int JENIS_KELAMIN_CUCU 		= 12;
		public static final int JENIS_KELAMIN_PEWARIS 	= 13;
		public static final int HAS_IBU				 	= 14;
	}
	
	public static final class ANSWER {
		public static final int YES 					= 0;
		public static final int NO 						= 1;
		public static final int RAGU 					= 2;
		
		public static final int SATU 					= 0;
		public static final int N 						= 1;
		
		public static final int LAKI_LAKI 				= 0;
		public static final int PEREMPUAN 				= 1;
		public static final int LAKI_LAKI_PEREMPUAN 	= 2;
	}

	public String template;
	public String name;
	public Integer type;
	public Integer question;
	public String[] answers = new String[3]; 
	public Integer solution;
	public String explanation;
	
	public Node() {
	}
	
	public Node(String template, String name, Integer type, Integer question, 
			String answer0, String answer1, String answer2, Integer solution, String explanation) {
		this.template = template;
		this.name = name;
		this.type = type;
		this.question = question;
		answers[0] = answer0;
		answers[1] = answer1;
		answers[2] = answer2;
		this.solution = solution;
		this.explanation = explanation;
	}
	
	@Override
	public String toString() {
		// Create builder
		StringBuilder sb = new StringBuilder();
		
		// add strings
		sb.append("{template:").append(template).append(", name:").append(name).append("}");
		
		return sb.toString();
	}
}